<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Location_model extends AppModel {
    var $_primary_key = LOCATION_LOCATION_ID;
    var $_tablename = LOCATION;
    var $_mapping = array(
                           array('id' => LOCATION_LOCATION_ID),
                           array('type' => LOCATION_TYPE),
                           array('address_id' => LOCATION_ADDRESS_ID),
                           array('name' => LOCATION_NAME),
                           array('map' => LOCATION_MAP),
                           array('direction1' => LOCATION_DIRECTIONS1),
                           array('direction2' => LOCATION_DIRECTIONS2),
						   array('image_id' => LOCATION_IMAGE_ID),
						   array('admin_id' => LOCATION_FRANCHISE_ID),
						   array('imagepath' => LOCATION_IMAGEPATH),
						   array('imagejson' => LOCATION_IMAGEJSON)
                            );

    public function Location_model($id = NULL){
        parent::AppModel($id);
    }
    
    public function get_lists($limit=NULL, $offset=NULL, $sort_field='', $sort_type=0){
        return parent::get_lists(array(LOCATION_FRANCHISE_ID => $this->admin_id), $limit, $offset, $sort_field, $sort_type);
    }
}
?>